//###############
//FILE : Section.java
//WRITER : Yaron Dinur, yarondi, 200184992
//WRITER : Yuval Ran, yuvran21, 032513483
//EXERCISE : oop ex1 2011
//DESCRIPTION:
//
//###############

package filescript;

import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;

import filters.FileFilter;
import filters.FilterManager;


public class Section {
	
	private ArrayList<filters.FileFilter> _filters;
	private ArrayList<actions.Action> _actions;
	private Comparator<File> _order;
	private ArrayList<String> _comments;
	
	//target - get the ORIGINAL arraylist and COPY it and WORK ON THE COPY.
	
	public Section (){
		_filters = new ArrayList<filters.FileFilter>();
		_actions = new ArrayList<actions.Action>();
		_order = null;
		_comments = new ArrayList<String>();
	}
	
	//public void runFilters(){
		//FilterManager.runFilters(_fileList, _filters);
	//}
	
	public void addFilter(filters.FileFilter filter){
		_filters.add(filter);		
	}
	
	public void addAction(actions.Action action){
		_actions.add(action);
	}
	
	public void addComment(String comment){
		_comments.add(comment);
	}
	
	public void setOrder(Comparator<File> order){
		_order = order;
	}
	
	public ArrayList<actions.Action> getActions(){
		return _actions;
	}
	
	public ArrayList<FileFilter> getFilters(){
		return _filters;
	}
	
	public ArrayList<String> getComments(){
		return _comments;
	}
	
	public Comparator<File> getOrder(){
		return _order;
	}
	
	
	public boolean hasActions(){
		return (!_actions.isEmpty());
	}
	
	public boolean hasOrder(){
		return (!(_order == null)); 
	}
	
	

}
